import axios from '@/api/fetch';
import SERVER from '@/api/server';

export const findAllRepair = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales`, {
    params
  });
export const getDefalValue = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/precontractStatus/getDefalValue`, {
    params
  });

export const updateBasicParam = params => axios.put(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/update`, params);

export const findStorageCode = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, {
    params
  });
export const getBrand = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/brandsdict2`, {
    params
  });

export const getSeries = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/brandsdict/${params}/seriessdict`, {
    params
  });

export const getModel = (brandId, seriesId) =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/brandsdict/${brandId}/seriessdict/${seriesId}/modelsdict`, {
    seriesId
  });

export const findAllRepairType = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/findAllRepairType`, {
    params
  });

export const queryType = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/queryType`, {
    params
  });

export const findInvoiceCode = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/findInvoiceCode`, {
    params
  });

export const findPaymentCode = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/findPaymentCode`, {
    params
  });

export const findUnitCode = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/findUnitCode`, {
    params
  });
// 查询维修项目
export const getRepairType = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/getRepairType`, { params });
